package com.banquetmanagementsystem.common.error;

/**
 * 错误枚举类
 *
 * @author tanghaihua
 */
public enum ErrorEnum implements ErrorCode {
    /**
     * 操作成功
     */
    SUCCESS("200", "操作成功"),
    /**
     * 操作失败
     */
    FAILED("500", "操作失败"),
    /**
     * 参数检验失败
     */
    VALIDATE_FAILED("422", "参数检验失败"),
    /**
     * 未经授权或未经认证
     */
    UNAUTHORIZED("401", "未经授权或未经认证"),
    /**
     * 拒绝访问
     */
    FORBIDDEN("403", "拒绝访问");
    private final String code;
    private final String msg;

    ErrorEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public String getMessage() {
        return this.msg;
    }

    @Override
    public String getCode() {
        return this.code;
    }
}
